package b1.mobile.blackberry.ui.component;

import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.container.VerticalFieldManager;

public class RoundVerticalFieldManager extends VerticalFieldManager {	
	private static final int MARGIN = 16;

	public RoundVerticalFieldManager() {
		super();
//		setMargin(MARGIN, MARGIN, MARGIN, MARGIN);
	}
	
	public RoundVerticalFieldManager(long style){
		super(style);
//		setMargin(MARGIN, MARGIN, MARGIN, MARGIN);
	}
	
	public void paint(Graphics g) {
		final int arcSize = 16;
		int oldColor = g.getColor();
		g.setColor(Color.GRAY);
		g.drawRoundRect(0, 0, getWidth(), getHeight(), arcSize, arcSize);
		g.setColor(oldColor);
		//g.setBackgroundColor(Color.WHITE);
		super.paint(g);
	}
	
	protected void paintBackground(Graphics g) {
		int oldColor = g.getColor();
		g.setColor(0x00F3F3F3);
		g.fillRoundRect(1, 1, getWidth()-1, getHeight()-1, MARGIN, MARGIN);
		//g.setColor(Color.WHITE);
		//g.drawRoundRect(0, 0, getWidth(), getHeight(), MARGIN, MARGIN);
		
		g.setColor(oldColor);
	}

}
